<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css"/>
</head>

<body>
    <div class="mui-content">
		<ul class="mui-table-view stock_list" id="ordrListsContent">
			<script type="text/template" id="itemslist">
			{{each datas as item i}}
			<li class="mui-table-view-cell" tapmode onclick="openStockWin('{{item.location}}', '{{item.description}}')">
                <div class="mui-table mui-navigate-right">
	                <div class="mui-table-cell mui-col-xs-10">
	                    <h4 class="mui-ellipsis">{{item.description}}</h4>
	                </div>
	                <div class="mui-table-cell mui-col-xs-2 mui-text-right">
	                    <span class="mui-badge mui-badge-inverted">{{item.cnt}}</span>
	                </div>
	            </div>
            </li>
            {{/each}}
            </script>
        </ul>
	</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/common.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/template.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	apiready = function () {
		onLoadData();
		Refresh(function() {
			onLoadData();
		});
	}
	function onLoadData () {
		searchText = $api.val($api.byId('searchText'));
		ajaxrd("queryLocationsTypeList", {}, function(ret, err) {
	      api.refreshHeaderLoadDone();
	      AddData('itemslist','ordrListsContent',ret,false);
		})
	}
	function openStockWin(_location, description){
//		openTastWin('stock_list',location+'/库存清单',{
//	    	location: location
//	    })
		openWin('stock_list',description,{
	        background: '#6098de',
	        color: '#fff',
	        rightButtons:[{
	        	iconPath:"widget://image/sys-icon.png"
	        }]
	    },{
	    	location2: _location
	    })
	}
</script>

</html>
